﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Micrhard.FMCG.Server.Validator;
using Microhard.Core.DBUtility;
using Microhard.Core.Extensions;

namespace Micrhard.FMCG.Server.Models
{
    [FluentValidation.Attributes.Validator(typeof(EmplyeeModelValidator))]
    public class EmployeeModel : BasePermissionModel
    {
        [ModelPKID]
        public Guid EmployeeID { set; get; }
        public Guid CompanyID { set; get; }
        public DateTime CreateTime { set; get; }
        public int Range { set; get; }
        public string Name { set; get; }
        public string Cellphone { set; get; }
        public string WeixinOpenID { set; get; }
        public string QQMail { set; get; }
        public string UserName { set; get; }

        public string BelongCompanyName { set; get; }
        public Guid UserID { set; get; }
        public string RangeDisplay
        {
            get
            {
                switch (this.Range)
                {
                    case (int)Micrhard.FMCG.Server.Models.Range.Documenter:
                        return Micrhard.FMCG.Server.Models.Range.Documenter.GetDisplayText();
                    case (int)Micrhard.FMCG.Server.Models.Range.Manager:
                        return Micrhard.FMCG.Server.Models.Range.Manager.GetDisplayText();
                    case (int)Micrhard.FMCG.Server.Models.Range.Monitor:
                        return Micrhard.FMCG.Server.Models.Range.Monitor.GetDisplayText();
                    case (int)Micrhard.FMCG.Server.Models.Range.Saler:
                        return Micrhard.FMCG.Server.Models.Range.Saler.GetDisplayText();
                    case (int)Micrhard.FMCG.Server.Models.Range.Store:
                        return Micrhard.FMCG.Server.Models.Range.Saler.GetDisplayText();
                }
                return string.Empty;
            }
        }

    }
}
